<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/">
    <xi:include href="master.html" />

<head>
    <title>Create new agreement</title>
</head>

<body>
    <span>${ET(tg.back_widget())}</span>
    <br />
    <?python
      from mnemoply.model import Organization, Trend, CustomerTariff, CashRegister, \
                                 TemporaryPaymentRecord, Student, Customer, InformationSource, Event

      rs = {}
      if kw.get('organization_id'):
        rs['organization_id'] = [Organization.get(int(kw.get('organization_id')))]
      if kw.get('trend_id'):
        rs['trend_id'] = [Trend.get(int(kw.get('trend_id')))]
      if kw.get('customer_tariff_id'):
        rs['customer_tariff_id'] = [CustomerTariff.get(int(kw.get('customer_tariff_id')))]
      if kw.get('register_id'):
        rs['register_id'] = [CashRegister.get(int(kw.get('register_id')))]
      if kw.get('temppr'):
        rs['temppr'] = [TemporaryPaymentRecord.get(int(kw.get('temppr')))]
      if kw.get('student'):
        rs['student'] = [Student.get(int(kw.get('student')))]
      if kw.get('customer'):
        rs['customer'] = [Customer.get(int(kw.get('customer')))]
      if kw.get('information_source_id'):
        rs['information_source_id'] = [InformationSource.get(int(kw.get('information_source_id')))]
      if kw.get('event_id'):
        rs['event_id'] = [Event.get(int(kw.get('event_id')))]
      if kw.get('date_enter_agreement'):
        rs['date_enter_agreement'] = [kw.get('date_enter_agreement')]
    ?>
    <span>${ET(form(kw, records=rs))}</span>
</body>
</html>
